import { BrowserRouter, Routes, Route } from "react-router-dom";
import { App, Welcome, Login, Notfound} from '../pages/base/index'
import { ModuleManage, UserManage, RoleManage } from '../pages/setCenter/index'
import { Chat, Echart, Editor } from '../pages/menu/index'
import { set } from '../configs/config'
import Example from '../pages/example'


function MyRouter(){
    return(
        <BrowserRouter>
            <Routes>
                <Route path="/" Component={App} >
                    {/* 菜单 */}
                    <Route index Component={Welcome} />
                    <Route path="/desk$/index" Component={Example} />
                    <Route path="/echarts" Component={Echart} />
                    <Route path="/editor" Component={Editor} />
                    <Route path="/chat" Component={Chat} />
                    {/* 设置中心 */}
                    <Route path={`/${set}/userManage`} Component={UserManage} />
                    <Route path={`/${set}/roleManage`} Component={RoleManage} />
                    <Route path={`/${set}/moduleManage`} Component={ModuleManage} />  
                </Route>
                <Route path="/login" Component={Login}></Route>
                <Route path="*" Component={Notfound}></Route>
            </Routes>
        </BrowserRouter>
    ) 
}
export default MyRouter